<?php
$res = move_uploaded_file($_FILES['image']['tmp_name'], '../test/uploads/'.$_FILES['image']['name']);
if($res) {
    $res = [
        'code' => 0,
        'msg'  => '上传成功',
        'data' => [
            'src' => $_FILES['image']['name']
        ]
    ]; 
} else {
    $res = [
        'code' => -1,
        'msg'  => '上传失败',
        'data' => []
    ]; 
}

exit(json_encode($res, JSON_UNESCAPED_UNICODE));